﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="LastOrderReport.aspx.cs" Inherits="MLY.Reports.SCCoverReports.LastOrderReport" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Last order report</title>
    <style type="text/css">
        .TitleStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:14px;
            font-weight:bold;
            color:Black;
        }
        .InerTextStyle
        {
            font-family:Arial Sans-Serif David;
            font-size:12px;
            color:Black;
        }
        
        
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div class="InerTextStyle">
        <asp:ToolkitScriptManager ID="ScriptManager1" runat="server"></asp:ToolkitScriptManager>
        <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <Triggers>
            <asp:PostBackTrigger ControlID="ExportImageButton" />
        </Triggers>
        <ContentTemplate>
            <asp:Label ID="PageTitlePanel" runat="server" Text="Last order report" CssClass="TitleStyle"></asp:Label>
            <br /><br />
            <table cellpadding="2" cellspacing="2">
            <tr>
                <td colspan="4">
                    <asp:RadioButtonList ID="OpenClosedRBL" runat="server">
                        <asp:ListItem Text="Show open orders" Value="1" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="Show closed orders" Value="0"></asp:ListItem>
                    </asp:RadioButtonList>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="DateFromTitleLabel" runat="server" Text='<%$Dict:reportsParams.Between %>'></asp:Label>
                </td>
                <td>
                    <KBMControls:KBMReadOnlyTxtBox runat="server" ID="txtFromDate"></KBMControls:KBMReadOnlyTxtBox>
                    
                    <KBMControls:KbmCalendar TargetControlID="txtFromDate" runat="server" ID="KbmCalendar11">
                    </KBMControls:KbmCalendar>
                </td>
                
                <td>
                    <asp:Label ID="DateTillTitleLabel"  runat="server"  Text='<%$Dict:reportsParams.And %>'></asp:Label>
                </td>
                <td>
                    <KBMControls:KBMReadOnlyTxtBox runat="server" ID="txtToDate"></KBMControls:KBMReadOnlyTxtBox>
                    
                    <KBMControls:KbmCalendar TargetControlID="txtToDate" runat="server" ID="KbmCalendar12">
                    </KBMControls:KbmCalendar>
                    <asp:Button ID="ClearDatesButton" runat="server" Text="Clear" OnClick="ClearDates" />
                </td>
                
            </tr>
            </table>
            <br />
            <asp:Button ID="GenerateReportButton" runat="server" Text="Generate report" OnClick="GenerateReport" />
            <asp:UpdateProgress AssociatedUpdatePanelID="UpdatePanel1" ID="UpdateProgress1" runat="server">
                <ProgressTemplate>
                    Loading...
                </ProgressTemplate>
            </asp:UpdateProgress>
            <br /><hr /><br />
            <asp:Panel ID="ReportPanel" runat="server" Visible="false">
                <asp:ImageButton ID="ExportImageButton" runat="server" ImageUrl="~/Images/excel.gif"
                 OnClick="ExportToExcel" ToolTip="Export to csv file" />
                <br />
                <asp:GridView ID="ReportGridview" runat="server" AutoGenerateColumns="false" AllowPaging="false"
                 CellPadding="2" CellSpacing="2">
                    <HeaderStyle BackColor="#86C2FF" />
                    <RowStyle CssClass="InerTextStyle" />
                    <Columns>
                        <asp:BoundField DataField="SendDate" HeaderText="Send Date" />
                        <asp:BoundField DataField="CustomerCatalougeCode" HeaderText="Customer Catalouge Code" />
                        <asp:BoundField DataField="OrderNumber" HeaderText="Order number" />
                    </Columns>
                </asp:GridView>
            </asp:Panel>
            <asp:SqlDataSource ID="ReportDataSource" runat="server" SelectCommandType="StoredProcedure"
            ConnectionString="<%$ ConnectionStrings:MLYConnectionString %>" 
            SelectCommand="SCCover_Reports_LastOrderReport"></asp:SqlDataSource> 
        </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    </form>
</body>
</html>
